<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<form id="pagerForm" method="get" model="viewRequest" action="${rootUrl}/goods/goods-image?goodsSpecClassId=${goodsSpecClassId}&goodsId=${goodsId}">
	<input type="hidden" name="viewRequest.page" value="${page.number}" />
	<input type="hidden" name="viewRequest.size" value="${page.size}" />
	<c:forEach items="${viewRequest.params}" var="params">
		<input type="hidden" id="${params.key}" name="viewRequest.params['${params.key}']" value="${params.value}" />
	</c:forEach>
	<c:forEach items="${viewRequest.sort}" var="sort">
		<input type="hidden" name="viewRequest.sort.${sort.key}" value="${sort.value}" />
	</c:forEach>
</form>

<div class="pageHeader" style="display: none;">
	<form rel="pagerForm" onsubmit="return dialogSearch(this);" action="${rootUrl}/goods/goods-image?goodsSpecClassId=${goodsSpecClassId}&goodsId=${goodsId}" method="get">
	<div class="searchBar">
	</div>
	</form>
</div>
<style type="text/css" media="screen">
    .imgs{text-align:center;}
    .imgs div{height:150px!important;}
</style>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="${rootUrl}/goods/goods-image/new?goodsSpecClassId=${goodsSpecClassId}&goodsId=${goodsId}" target="dialog" width="860" height="460" rel="goodsImage_new" title="添加"><span>添加</span></a></li>
			<li><a title="确实要删除这些记录吗?" target="selectedTodo" targetType="dialog" rel="ids" href="${rootUrl}/goods/goods-image!destroyBatch" class="delete"><span>删除</span></a></li>
		</ul>
	</div>
	<table class="table" targetType="dialog"  width="100%" layoutH="0">
		<thead>
			<tr>
				<th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
				<th width="30" align="center" >排序</th>
				<th width="120" align="center">图片</th>
				<th width="120">是否默认</th> 
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.content}" var="goodsImage" varStatus="status">
			<tr target="data_id" rel="${goodsImage.id}">
				<td><input name="ids" value="${goodsImage.id}" type="checkbox"></td>
				<td>${goodsImage.sort}</td>
				<td class="imgs"><div class="imgContainer" >
				<a href="#">
				<img id="myEditorImageabcd" src="${goodsImage.imgurl}" /></a></div></td>
				<td><c:if test="${goodsImage.isDefault == '1'}">是</c:if><c:if test="${goodsImage.isDefault != '1'}">否</c:if></td>
				<td>
				    <a title="查看" target="_blank" width="860" height="460" rel="goods_image_index" title="图片"  href="${goodsImage.imgurl}" class="btnView">图片</a>
				    <a title="编辑" target="dialog" width="860" height="460" rel="goodsSpecValue_edit" title="修改"  href="${rootUrl}/goods/goods-image/${goodsImage.id}/edit" class="btnEdit">编辑</a>
					<a title="确定要删除这个记录吗?" target="dialogAjaxTodo" href="${rootUrl}/goods/goods-image/${goodsImage.id}?_method=delete" class="btnDel">删除</a>
					
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="dialogPageBreak({numPerPage:this.value})">
				<option value="${page.size}">${page.size}</option>
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select>
			<span>条，共${page.totalElements}条 </span>
		</div>
		<div class="pagination" targetType="dialog" totalCount="${page.totalElements}" numPerPage="${page.size}" pageNumShown="10" currentPage="${page.number}"></div>
	</div>
</div>